<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>布局小技巧2</title>
    <style>
        .outer{
            width: 400px;
            height: 400px;
            background-color: gray;
        /*    行内元素按文字处理,让inner水平居中*/
            text-align: center;
        /*    让元素垂直居中*/
            line-height: 400px;
        }
        .inner{
            background-color: orange;
            font-size: 20px;
        }
    </style>
</head>
<body>
<div class="outer">
    <span class="inner">出来玩呀!</span>
</div>
</body>
</html>